package pzl.mn.practice.live_data;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Observer;

import android.os.Bundle;
import android.widget.TextView;

import pzl.mn.practice.R;

public class LiveDataActivity extends AppCompatActivity {
    TextView tvLiveDataWifi;
    WifiData wifiData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_live_data);

        tvLiveDataWifi = findViewById(R.id.tvLiveDataWifi);
        wifiData = WifiData.getInstance(this);
        wifiData.observe(this, new Observer<String>() {
            @Override
            public void onChanged(String s) {
                tvLiveDataWifi.setText(s);
            }
        });
    }


}
